package com.tc.entity;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;

/**
 * Created by cai.tian on 2017/5/8.
 */
public class UserInfo {
    @NotNull(message = "id不能为空")
    private long id;
    private String loginname;
    private String password; // 加密
    @NotEmpty(message = "用户名不能为空")
    private String name;
    public UserInfo(){}
    public UserInfo(Long id,String loginname,String password,String name){
        this.id=id;
        this.loginname=loginname;
        this.password=password;
        this.name=name;
    }
    public void setId(long id) {
        this.id = id;
    }

    public void setLoginname(String loginname) {
        this.loginname = loginname;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getId() {
        return id;
    }

    public String getLoginname() {
        return loginname;
    }

    public String getPassword() {
        return password;
    }

    public String getName() {
        return name;
    }

    public UserInfo clone()
    {
        UserInfo u=new UserInfo();
        u.setPassword(this.getPassword());
        u.setId(this.getId());
        u.setName(this.getName());
        u.setLoginname(this.getLoginname());
        return u;
    }
}
